#ifndef NETWORKSANNER_H
#define NETWORKSANNER_H

#include <QObject>

class ARPScanner;
class ICMPScanner;
class TCPScanner;
class UDPScanner;

class NetworkSanner : public QObject
{
    Q_OBJECT
public:
    explicit NetworkSanner(QObject *parent = nullptr);
    ~NetworkSanner();

    void Arp_Scan(QString startIPStr, QString endIPStr);
    void ICMP_Scan(QString dstIPStr);
    void TCP_Connect_Scan(QString startIPStr, QString endIPStr, ushort startPort, ushort endPort);
    void TCP_Syn_Scan(QString DestIP, unsigned short StartPort, unsigned short EndPort);

    bool CheckIP(QString IP);

    void StopTCPSyn();

    void StartTCPSyn();

    void TCP_Fin_Scan(QString DestIP, unsigned short StartPort, unsigned short EndPort);

    void StopTCPFin();

    void StartTCPFin();

    void UDP_Scan(QString DestIP, unsigned short StartPort, unsigned short EndPort);

private:
    ARPScanner* m_arpScanner;
    ICMPScanner* m_icmpScanner;
    TCPScanner* m_tcpScanner;

    UDPScanner* m_udpScanner;

signals:
    void SendARPItem(QString dstIp, QString dstMac);
    void SendICMPInfo(QString dstIp, bool bIsAlive);
    void SendTCPConnectItem(QVector<QString> item);
    void SendTCPSynItem(QVector<QString> item);
    void SendTCPFinItem(QVector<QString> item);
    void SendUDPItem(QVector<QString> item);

    void TCPConnectEnd();
};

#endif // NETWORKSANNER_H
